package com.czy.booktest02.demos.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.czy.booktest02.demos.pojo.dto.BookRASDto;
import com.czy.booktest02.demos.pojo.po.Book;
import com.czy.booktest02.demos.pojo.po.BookCategory;
import com.czy.booktest02.demos.pojo.po.Books;
import com.czy.booktest02.demos.pojo.po.Publisher;
import com.czy.booktest02.demos.pojo.vo.BookVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 *
 **/
@Mapper
public interface BookMapper extends BaseMapper<Books> {
    int updateBook(Books book);

    int addBook(Books book);

    List<BookCategory> selectAllCategory();

    List<Publisher> selectAllPublisher();



    int isStatus(BookRASDto bookRASDto);

    int isRecommend(BookRASDto bookRASDto);

    int deleteBook(String bookName);


    int deleteBooks(int categoryId);

    int deleteBooksByPublisher(Integer publisherId);

    int updateFileId(int bookId,int fileId);
    Books selectByName(String bookName);

    List<BookVO> selectAllBook();

    int updateStock(int bookId, int quantity);

    List<Books> selectStock();

    Books selectId(int bookId);
}
